From 770725fbdcc8ea7bf47ef0af5a43a239bef98ff6 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 16 Aug 2022 15:31:41 -0700 Subject: sveltekit route migration --- src/routes/[username]/transactions/+page.svelte | 60 +++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/routes/[username]/transactions/+page.svelte (limited to 'src/routes/[username]/transactions') diff --git a/src/routes/[username]/transactions/+page.svelte b/src/routes/[username]/transactions/+page.svelte new file mode 100644 index 00000000..c91fd900 --- /dev/null +++ b/src/routes/[username]/transactions/+page.svelte @@ -0,0 +1,60 @@ + + +{#if $user} + + +
+

+ Transaction History +

+ +
+
+

AMOUNT

+

TYPE

+

TIME

+
+ +
+ {#if transactions.length} + {#each transactions as tx} +
+
+ {tx.amount > 0 ? '+' : ''}{new Intl.NumberFormat('en-US', { + style: 'currency', + currency: 'USD' + }).format(tx.amount * (tx.rate / 100000000))} + + + {tx.amount > 0 ? '+' : ''}{new Intl.NumberFormat('en-US', { + maximumFractionDigits: 0 + }).format(tx.amount)} + SATS + +
+ +
+ {tx.amount < 0 ? 'Sent' : 'Received'} +
+ +
+ {new Date(tx.createdAt).toLocaleDateString(undefined, { dateStyle: 'medium' })} +
+
+ {/each} + {:else} +

No transactions yet.

+ {/if} +
+
+
+{/if} -- cgit v1.2.3